The present invention relates to graphics generation and display systems and methods, and more particularly, to methods and systems of performing non-divisible memory operations for accessing a z-buffer during the generation and display of three-dimensional graphical images in a burst mode transfer data storage environment.
In many modern computers or computerized systems, a graphics display system provides a display device along with memory and a processor to display graphical images. The display device generally includes a pixel-oriented output device that displays a plurality of pixels, a pixel being the smallest addressable element in the output device. Examples of a pixel-oriented output devices include CRT monitors, LCD displays, and the like. The individual pixels on the output device are addressed using x and y coordinates, in the same manner as points on a graph are addressed.
The memory includes a frame buffer. The frame buffer stores a pixel number map corresponding to the graphical image displayed on the output device. The pixel number map is generally represented by a grid-like array of pixels where each pixel is assigned a color and a shade value. The processor computes and updates the pixel values in the frame buffer when a new graphical image is to be displayed. In processing a three-dimensional graphical object, the depth attribute of the object must be considered prior to the updating of any pixel values in the frame buffer. If the new object being processed is located behind and is partially obscured by the displayed object, only a visible portion of the new object should be displayed. On the other hand, if the new object is completely obscured by the displayed object, no updates to the frame buffer are necessary and the new object is not displayed.
Three-dimensional objects are often represented by a set of vertices defining polygon surfaces. Each vertex is defined by x, y, and z dimensions corresponding to the X, Y, and Z axes. The X and Y axes define a view plane and the Z axis represents a distance from the view plane. A z coordinate value, therefore, indicates the depth of an object at a pixel location defined by specific x and y coordinates.
Therefore, in a three-dimensional graphics display system, the memory also includes a z-buffer. The z-buffer stores the z-value of each pixel, and hence, the depth value of each pixel, and permits performance of depth analysis of a three-dimensional object. This process is often referred to as a xe2x80x9chidden surface removal process.xe2x80x9d When a new object moves into a displayed portion of the view plane, a determination must be made as to whether the new object is visible and should be displayed, or whether the new object is hidden by objects already in the displayed portion of the view plane. The determination of whether the new object should be displayed is generally done on a pixel-by-pixel basis.
Thus, for each pixel, defined by x-y coordinates, the depth, or z-value, of the new object is compared to the depth, or z-value, of the currently displayed object. If the comparison indicates that the new pixel to be drawn is in front of the old pixel in the z-buffer (i.e., the new z-value is less than the old z-value), the old z-value is replaced with the new z-value, and red, blue, green and intensity values for the new pixel are written to the frame buffer for being displayed in the place of the old pixel. On the other hand, if the new pixel is located behind the old pixel, it will be hidden from view and need not be displayed. In this situation, the old z-value is kept in the z-buffer and the new z-value is discarded. The old pixel remains displayed and is not replaced by the new pixel.
The pixel-by-pixel analysis during the display or rendering of an object requires a z-buffer read for each pixel to compare the z-value of the old pixel with respect to the new pixel. Additionally, a conditional update of the z-buffer is required based on the comparison of the z-values. Because z-buffers are large and cannot be stored on-chip, thereby requiring external memory access, such z-comparisons and updates significantly slow down the rendering process. However, many advancements with memory technology to increase the speed of memory access, and thus the pixel-by-pixel analysis, have been achieved. In particular, one advancement to increase the speed of memory access that is often utilized is a burst mode transfer technique.
Burst mode transfer combines individual read requests and write requests to memory into aggregates, with each aggregate being formed of many individual read requests or write requests. Burst mode transfer sends these aggregates in bursts, such that an aggregate of individual read requests are transferred followed by an aggregate of individual write requests. Therefore, groups of read or write requests can be serviced at the same time instead of individually and thus be serviced quicker. The order of the individual read requests in relation to the individual write requests, however, is not necessarily maintained.
Thus, if the device is transmitting information sequentially loaded into an area in memory, the order in which the information is received may not be the order in which it was sequentially loaded into memory. In other words, z-buffering operations that perform the hidden surface removal process may not operate as intended. The z-buffering operations include numerous atomic operations. An atomic operation is a read-modify-write request performed in a non-divisible manner. As such, data at times needs to be fetched, modified and written back to the same memory location in the z-buffer in an ordered fashion to maintain memory coherency. However, during a burst mode transfer, memory coherency, i.e., the order in which data is stored in memory, can be disrupted.
For example, a first read-modify-write and a second read-modify-write request each directed to the same memory location in the z-buffer are received. Upon a burst mode transfer occurring, two read requests corresponding to the first and second read-modify-write requests are serviced prior to the two write requests. Therefore, the second read request in the first read-modify-write request is performed prior to the first write request in the read-modify-write request, and thereby disrupting the coherency of the data stored in the z-buffer. The lack of data coherency causes invalid data to be used. Since both read-modify-write requests are directed towards the same memory location, the second read request will read data that otherwise would have been modified by the first write in the first read-modify-write request if both read-modify-write requests were performed in atomic order.
The use of both burst mode transfer technology and atomic operations is therefore problematical. Burst mode transfer technology requires that at times information be transmitted in an order possibly different from that otherwise expected by the sender. The use of atomic operations, on the other hand, requires that received requests be in a predefined order with respect to the atomic operations. Accordingly, methods and systems which overcome the obstacles of using of both burst mode transfer technology and atomic operations are desirable.
The present invention provides a method of performing non-divisible operations, a non-divisible operation includes a read request and a write request, in a burst mode transfer storage environment of a graphics system. The method includes the process of receiving an individual read request in a non-divisible operation. The received individual read request contains address information. The method also includes comparing address information in the received read request to address information contained in previous read requests received. The method services the previous read requests when the address information contained in the received individual read request corresponds to the address information contained in one of the previous read requests. The method halts the servicing of the previous read requests when the one of the previous read requests is serviced. The method then continues by servicing previous write requests in a second buffer until the second buffer is empty.
In another embodiment, the present invention provides a method of performing non-divisible operations in a burst mode transfer storage environment of a graphics system. The method includes the process of receiving a plurality of non-divisible operations that include a plurality of read requests and a plurality of write requests. Each of the plurality of read requests contain address information. When address information in a first one of the plurality of read requests corresponds to address information contained in a second one of the plurality of read requests, the method services the plurality of read requests. The method halts the service of the plurality of read requests when the first one of the plurality of read requests is serviced and then services the plurality of write requests. The method then restarts the service of the plurality of read requests when all the plurality of write request have been serviced.
In another embodiment, a z-unit coupled to a graphics engine and a memory is provided. The z-unit includes a z-render block generating addresses from signals received from a graphics engine. Also, the z-unit includes a z-read buffer storing read addresses and a z-write buffer storing write addresses. Furthermore, the z-unit includes z-history block tracking the generated addresses to ensure that memory corresponding to the write addresses are updated properly in relation to the read addresses.
In another embodiment, a three-dimensional graphics system operating in a burst mode transfer storage environment is provided. The three-dimensional graphics system includes memory that includes a z-buffer. The memory is configured to transfer data in groups corresponding to a memory bus width. A graphics engine coupled to the memory and configured to initiate non-divisible operations. Also, a z-unit, coupled to the graphics engine and the memory, is configured to interpret the non-divisible operations and execute the non-divisible operations in conjunction with the memory in a predetermined order.